from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1261447981.4379461
_template_filename='/home/dcrowdy/src/arkaiv/arkaiv/templates/searchresults.mak'
_template_uri='/searchresults.mak'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding=None
_exports = []


def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
    pass
def _mako_inherit(template, context):
    _mako_generate_namespaces(context)
    return runtime._inherit_from(context, u'/autohandler', _template_uri)
def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        h = context.get('h', UNDEFINED)
        c = context.get('c', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 1
        __M_writer(u' \n<h2>Search results</h2>\n\n<hr>\n<p>Items:</p>\n')
        # SOURCE LINE 6
        __M_writer(unicode( h.form(h.url_for(controller='playlist', action='additemstoplaylist'), name='items', multipart=True) ))
        __M_writer(u'\n<table>\n<tr>\n<td>Item</td>\n<td>Name</td>\n<td></td>\n</tr>\n')
        # SOURCE LINE 13

        i = 0
        
        
        __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin()[__M_key]) for __M_key in ['i'] if __M_key in __M_locals_builtin()]))
        # SOURCE LINE 15
        __M_writer(u'\n\n')
        # SOURCE LINE 17
        for item in c.items:
            # SOURCE LINE 18
            __M_writer(u'<tr>\n<td>')
            # SOURCE LINE 19
            __M_writer(unicode(item['index']))
            __M_writer(u'</td>\n<td>')
            # SOURCE LINE 20
            __M_writer(unicode( h.link_to(item['name'], h.url_for(controller='item', action="displayitem", edit="no", id=item['index']))))
            __M_writer(u"</td>\n<td><input type='checkbox' name='")
            # SOURCE LINE 21
            __M_writer(unicode(i))
            __M_writer(u"' value='")
            __M_writer(unicode(item['index']))
            __M_writer(u"'></td>\n</tr>\n")
            # SOURCE LINE 23

            i = i + 1
            
            
            __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin()[__M_key]) for __M_key in ['i'] if __M_key in __M_locals_builtin()]))
            # SOURCE LINE 25
            __M_writer(u'\n')
        # SOURCE LINE 27
        __M_writer(unicode( h.end_form() ))
        __M_writer(u' \n</table>\nPlaylist:\n')
        # SOURCE LINE 30
        __M_writer(unicode( h.select("playlist", c.playlistinfo)))
        __M_writer(u'\n\n')
        # SOURCE LINE 32
        __M_writer(unicode( h.hidden_field('nummetas', value=i) ))
        __M_writer(u'\n')
        # SOURCE LINE 33
        __M_writer(unicode( h.submit('Add') ))
        __M_writer(u' \n</form>\n\n<hr>\n<p>Meta names:</p>\n')
        # SOURCE LINE 38
        __M_writer(unicode( h.form(h.url_for(controller='playlist', action='additemstoplaylist'), name='metas', multipart=True) ))
        __M_writer(u'\n<table>\n<tr>\n<td>Name</td>\n<td>Content</td>\n<td></td>\n</tr>\n')
        # SOURCE LINE 45

        i = 0
        
        
        __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin()[__M_key]) for __M_key in ['i'] if __M_key in __M_locals_builtin()]))
        # SOURCE LINE 47
        __M_writer(u'\n')
        # SOURCE LINE 48
        for meta in c.metas:
            # SOURCE LINE 49
            __M_writer(u'<tr>\n<td>')
            # SOURCE LINE 50
            __M_writer(unicode(meta['name']))
            __M_writer(u'</td>\n<td>')
            # SOURCE LINE 51
            __M_writer(unicode(meta['content']))
            __M_writer(u'</td>\n<td>')
            # SOURCE LINE 52
            __M_writer(unicode( h.link_to(meta['itemname'], h.url_for(controller='item', action="displayitem", edit="no", id=meta['itemindex']))))
            __M_writer(u"</td>\n<td><input type='checkbox' name='")
            # SOURCE LINE 53
            __M_writer(unicode(i))
            __M_writer(u"' value='")
            __M_writer(unicode(meta['itemindex']))
            __M_writer(u"'></td>\n</tr>\n")
            # SOURCE LINE 55

            i = i + 1
            
            
            __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin()[__M_key]) for __M_key in ['i'] if __M_key in __M_locals_builtin()]))
            # SOURCE LINE 57
            __M_writer(u'\n')
        # SOURCE LINE 59
        __M_writer(u'</table>\nPlaylist:\n')
        # SOURCE LINE 61
        __M_writer(unicode( h.select("playlist", c.playlistinfo)))
        __M_writer(u'\n\n')
        # SOURCE LINE 63
        __M_writer(unicode( h.hidden_field('nummetas', value=i) ))
        __M_writer(u'\n')
        # SOURCE LINE 64
        __M_writer(unicode( h.submit('Add') ))
        __M_writer(u' \n')
        # SOURCE LINE 65
        __M_writer(unicode( h.end_form() ))
        __M_writer(u' \n\n<hr>\nClips:\n<table>\n')
        # SOURCE LINE 70
        __M_writer(unicode( h.form(h.url_for(controller='playlist', action='addclipstoplaylist'), name='clips', multipart=True) ))
        __M_writer(u'\n<tr>\n<td>id</td>\n<td>desc</td>\n<td></td>\n</tr>\n')
        # SOURCE LINE 76

        i = 0
        
        
        __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin()[__M_key]) for __M_key in ['i'] if __M_key in __M_locals_builtin()]))
        # SOURCE LINE 78
        __M_writer(u'\n')
        # SOURCE LINE 79
        for clip in c.clips:
            # SOURCE LINE 80
            __M_writer(u'<tr>\n<td>')
            # SOURCE LINE 81
            __M_writer(unicode(clip['id']))
            __M_writer(u'</td>\n<td>')
            # SOURCE LINE 82
            __M_writer(unicode(clip['itemname']))
            __M_writer(u'</td>\n<td>')
            # SOURCE LINE 83
            __M_writer(unicode( h.link_to(clip['desc'], h.url_for(controller='item', action="displayitem", edit="no", id=clip['itemindex'], playclip=clip['id']))))
            __M_writer(u"</td>\n<td><input type='checkbox' name='")
            # SOURCE LINE 84
            __M_writer(unicode(i))
            __M_writer(u"' value='")
            __M_writer(unicode(clip['index']))
            __M_writer(u"'></td>\n</tr>\n")
            # SOURCE LINE 86

            i = i + 1
            
            
            __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin()[__M_key]) for __M_key in ['i'] if __M_key in __M_locals_builtin()]))
            # SOURCE LINE 88
            __M_writer(u'\n')
        # SOURCE LINE 90
        __M_writer(u'</table>\nPlaylist:\n')
        # SOURCE LINE 92
        __M_writer(unicode( h.select("playlist", c.playlistinfo)))
        __M_writer(u'\n\n')
        # SOURCE LINE 94
        __M_writer(unicode( h.hidden_field('numclips', value=i) ))
        __M_writer(u'\n')
        # SOURCE LINE 95
        __M_writer(unicode( h.submit('Add') ))
        __M_writer(u' \n')
        # SOURCE LINE 96
        __M_writer(unicode( h.end_form() ))
        __M_writer(u' \n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


